package com.iqiyi.pps.epg.core.model.log;

import com.iqiyi.pps.epg.core.dao.base.BaseDao;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.Map;

@Entity
@Table(name = "interface_log")
@Cache(usage = CacheConcurrencyStrategy.NONE)
public class InterfaceLog extends BaseDao<InterfaceLog> {
    public static final Map<Byte, String> BASE_TYPEID_MAP = new HashMap<Byte, String>() {{
        put((byte) 1, "内部");
        put((byte) 2, "外部");
    }};

    public static final Map<Byte, String> BASE_PLATFORM_MAP = new HashMap<Byte, String>() {{
        put((byte) 1, "秀场");
        put((byte) 2, "游戏1");
    }};

    private Long id;
    private Byte typeId;
    private Byte platform;
    private String appkey;
    private String name;
    private String serverIp;
    private String params;
    private String response;
    private Timestamp reqTime;
    private Timestamp resTime;
    private Integer usageTime;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "type_id")
    public Byte getTypeId() {
        return typeId;
    }

    public void setTypeId(Byte typeId) {
        this.typeId = typeId;
    }

    public Byte getPlatform() {
        return platform;
    }

    public void setPlatform(Byte platform) {
        this.platform = platform;
    }

    public String getAppkey() {
        return appkey;
    }

    public void setAppkey(String appkey) {
        this.appkey = appkey;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "server_ip")
    public String getServerIp() {
        return serverIp;
    }

    public void setServerIp(String serverIp) {
        this.serverIp = serverIp;
    }

    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

    public String getResponse() {
        return response;
    }

    public void setResponse(String response) {
        this.response = response;
    }

    @Column(name = "req_time")
    public Timestamp getReqTime() {
        return reqTime;
    }

    public void setReqTime(Timestamp reqTime) {
        this.reqTime = reqTime;
    }

    @Column(name = "res_time")
    public Timestamp getResTime() {
        return resTime;
    }

    public void setResTime(Timestamp resTime) {
        this.resTime = resTime;
    }

    @Column(name = "usage_time")
    public Integer getUsageTime() {
        return usageTime;
    }

    public void setUsageTime(Integer usageTime) {
        this.usageTime = usageTime;
    }
}
